package com.oracle.mapper;

import com.oracle.pojo.Book;
import com.oracle.pojo.BookExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface BookMapper {
    long countByExample(BookExample example);

    int deleteByExample(BookExample example);

    int deleteByPrimaryKey(Integer bid);

    int insert(Book record);

    int insertSelective(Book record);

    List<Book> selectByExample(BookExample example);

    Book selectByPrimaryKey(Integer bid);

    int updateByExampleSelective(@Param("record") Book record, @Param("example") BookExample example);

    int updateByExample(@Param("record") Book record, @Param("example") BookExample example);

    int updateByPrimaryKeySelective(Book record);

    int updateByPrimaryKey(Book record);

    List<Book> selectNewBooksByExample(BookExample example);


    @Select("select title from book where bid = #{bid}")
    String selectBnameBybid(@Param("bid") Integer bid);

    @Select("select photo from book where bid = #{bid}")
    String selectBnameBybid2(@Param("bid") Integer bid);

    @Select("select * from book where stated=0 order by bnum desc limit 0,10")
    List<Book> selectBooksByNumOrder();

    @Select("select * from book where cid=#{cid} and stated=0 limit 0,4")
    List<Book> selectBooksByCid(@Param("cid") Integer cid);
}